package com.ruoyi.biz.homepage.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.biz.homepage.service.IHomePageService;
import com.ruoyi.biz.letter.domain.BizCityLetter;
import com.ruoyi.biz.organization.domain.BizCompany;
import com.ruoyi.biz.organization.service.IBizCompanyService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 查询地市认领件统计
 *
 * @author Fei.Cong
 * @date 2023-04-21
 */
@RestController
@RequestMapping("/homepage/totaldata")
public class HomePageController extends BaseController {

    @Autowired
    @Qualifier("homePageServiceImpl")
    private IHomePageService homePageService;

    @Autowired
    @Qualifier("unResolvedReportServiceImpl")
    private IHomePageService unResolvedReportServiceImpl;

    @Autowired
    @Qualifier("dispatchReportServiceImpl")
    private IHomePageService dispatchReportService;

    /**
     * 查询地市认领件统计
     */
    @GetMapping("/totallist")
    public AjaxResult list(BizCityLetter bizCityLetter) {
        return success(homePageService.totallist(bizCityLetter));
    }

    /**
     * 查询地市化解统计
     */
    @GetMapping("/totallistDispatch")
    public AjaxResult listDispatch(BizCityLetter bizCityLetter) {
        return success(dispatchReportService.totallist(bizCityLetter));
    }

    /**
     * 查询地市未化解统计
     */
    @GetMapping("/totallistUnresolve")
    public AjaxResult listUnresolve(BizCityLetter bizCityLetter) {
        return success(unResolvedReportServiceImpl.totallist(bizCityLetter));
    }
}
